/**************************************************************************** 
 * Meta，一个轻量级的静态分区Hypervisor 
 *
 * 版权(c) , 2022-
 *
 * 作者:
 *      Tupelo Shen <shenwanjiang2013@163.com>
 *
 * Meta是一个自由软件，你可以在遵循GNU GPLv2协议的条件下，重新修改并发布它。
 *
 ***************************************************************************/

#ifndef __ARCH_PLATFORM_H__
#define __ARCH_PLATFORM_H__

#include <arch/meta.h>

struct arch_platform {
    struct gic_dscrp {
        paddr_t gicc_addr;
        paddr_t gich_addr;
        paddr_t gicv_addr;
        paddr_t gicd_addr;
        paddr_t gicr_addr;
        irqid_t maintenance_id;
        size_t  interrupt_num;
    } gic;

    struct {
        paddr_t     base;
        irqid_t     interrupt_id;
        streamid_t  global_mask;

        size_t      group_num;
        struct smmu_group {
            streamid_t group_mask;
            streamid_t group_id;
        } *smmu_groups;

    } smmu;

    struct {
        paddr_t     base_addr;
    } generic_timer;

    struct clusters {
        size_t      num;
        size_t*     core_num;
    } clusters;
};

struct platform_desc;
unsigned long  platform_arch_cpuid_to_mpdir(const struct platform_desc* plat,
                                            cpuid_t cpuid);
// int64_t platform_arch_mpidr_to_cpuid(const struct platform_desc* plat,
//                                       uint64_t mpidr);
#endif /* __ARCH_PLATFORM_H__ */
